<!--loading-->
<template>
  <transition name="van-fade">
    <div v-show=" show" class="loading ">
      <div class="loading-content">
        <div class="box">
          <div class="loader">

          </div>
          <img src="~@/assets/logo.png" alt="logo" />
          <div class="ball"></div>
        </div>
      </div>
    </div>
  </transition>
</template>

<script>
export default {
  name: 'Loading',
  props: {
    show: { // 是否显示此loading
      type: Boolean,
      default: false
    }
  },
  data() {
    return {}
  },
  created() {
  },
  methods: {
  }
}
</script>

<style lang="scss">
.loading {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3010;
  background-color: transparent;
  .loading-content {
    height: 100%;
    width: 100%;
  }
  .loading-content {
    padding: 0.3rem;

    position: relative;

    .box {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      border-radius: 14px;
      width: 200px;
      background-color: rgba(0, 0, 0, 0.06);
      height: 150px;
      color: rgba(200, 200, 200, 0.5);
      transition: 0.3s color, 0.3s border;
      img {
        position: absolute;
        top: 53%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 80px;
        height: 80px;
      }
    }

    .loader {
      position: absolute;
      left: calc(50% - 50px);
      top: calc(50% - 50px);
      transform: rotateZ(0deg);
      border-radius: 50%;
      border: 1px solid transparent;
      border-top-color: #e45b5b;
      width: 100px;
      height: 100px;

      pointer-events: none;

      animation: 1s loader-05 linear infinite;
      z-index: 3;
    }
    .ball {
      position: absolute;
      left: calc(50% - 50px);
      top: calc(50% - 50px);
      transform: rotateZ(0deg);
      border-radius: 50%;
      border: 1px solid #eaeaea;
      width: 100px;
      height: 100px;

      pointer-events: none;
    }
    @keyframes loader-05 {
      0% {
        transform: rotateZ(0deg);
      }
      100% {
        transform: rotateZ(360deg);
      }
    }
  }
}
</style>
